<?php
/**
 * 门店接口配置类
 *
 * @author xiayuanjun@shopex.cn
 * @version 0.1
 *
 */
class erpapi_store_config extends erpapi_config
{
    /**
     * 应用级参数
     *
     * @param String $method 请求方法
     * @param Array $params 业务级请求参数
     * @return void
     * @author 
     **/
    public function get_query_params($method, $params){
        $query_params = array(
                'api'       => $method,
                'format'       => 'json',
                'from_node_id' => base_shopnode::node_id('ome'),
                'to_node_id'   => $this->__channelObj->store['node_id'],
        );
        if(in_array($method,$this->_top_list)){
            //走top的接口
            $query_params['method']    = 'store.common.top.send';
            $query_params["v"] = "1.0";
            $query_params["certi_id"] = base_certificate::certi_id();
            $query_params["app_id"] = "ecos.ome";
        }else{
            //走奇门的接口
            $query_params['method'] = 'store.common.qimen.send';
            $query_params['tb_version'] = "1.0";
        }
        return $query_params;
    }

     private $__global_whitelist = array(
        WMS_SALEORDER_CREATE,
        WMS_SALEORDER_CANCEL,
        WMS_SALEORDER_GET,
        WMS_ITEM_ADD,
        WMS_ITEM_UPDATE,
        WMS_RETURNORDER_CREATE,
        WMS_RETURNORDER_CANCEL,
        WMS_RETURNORDER_GET,
        WMS_TRANSFERORDER_CREATE,
        WMS_TRANSFERORDER_CANCEL,
        WMS_INORDER_CREATE,
        WMS_INORDER_CANCEL,
        WMS_INORDER_GET,
        WMS_OUTORDER_CREATE,
        WMS_OUTORDER_CANCEL,
        WMS_OUTORDER_GET,
        WMS_WAREHOUSE_LIST_GET,
        WMS_LOGISTICS_COMPANIES_GET,
        WMS_VENDORS_GET,
        WMS_ORDER_CANCEL,
        OMNIORDER_ALLOCATEDINFO_SYNC,
        QIMEN_OMNIORDER_ACCPETED,
        QIMEN_OMNIORDER_STORE_REFUSE,
        QIMEN_OMNIORDER_STORE_CONSIGNED,
    );
    
    private $_top_list = array("taobao.omniorder.allocatedinfo.sync");
    
}